{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}宠物领养系统{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .pet-card { margin-bottom: 20px; }
        .pet-img { height: 200px; object-fit: contain; background-color: #f8f9fa; }
    </style>
    <link rel="stylesheet" href="{% static 'css/custom.css' %}">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="/">宠物领养系统</a>
            <div class="collapse navbar-collapse">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item"><a class="nav-link" href="/pets/">宠物列表</a></li>
                </ul>
                <ul class="navbar-nav">
                    {% if user.is_authenticated %}
                        <li class="nav-item"><a class="nav-link" href="{% url 'application_list' %}">我的申请</a></li>
                        {% if user.is_staff %}
                            <li class="nav-item"><a class="nav-link" href="/pet-admin/">后台管理</a></li>
                        {% endif %}
                        <li class="nav-item">
                            <form method="post" action="{% url 'logout' %}" class="nav-link">
                                {% csrf_token %}
                                <button type="submit" class="btn btn-link nav-link p-0">退出登录</button>
                            </form>
                        </li>
                    {% else %}
                        <li class="nav-item"><a class="nav-link" href="{% url 'login' %}">登录</a></li>
                        <li class="nav-item"><a class="nav-link" href="{% url 'register' %}">注册</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <!-- 内容区 -->
    <div class="container mt-4 mb-5">
        {% block content %}{% endblock %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>